/*分页*/
document.onload = page();
var new_page;
var number_of_pages;
var show_per_page;
function page() {
    new_page = 1;
    show_per_page = 10;
    var number_of_items;
    number_of_items = $('.selected table tbody').find('.content1').length;
    $('.selected table tbody .content1').hide();
    $('.selected table tbody .content1').slice(0, show_per_page).show();
    number_of_pages = Math.ceil(number_of_items / show_per_page);
    $("#page a b").text(new_page + "/" + number_of_pages);
}
function first() {
    new_page = 1;
    go_to_page(new_page);
}
function last() {
    new_page = number_of_pages;
    go_to_page(new_page);
}
function previous() {
    var page_num = parseFloat($("#page a b").text()) - 1;
    if (page_num >= 1) {
        go_to_page(page_num);
    } else {
        go_to_page(1);
    }
}
function next() {
    var page_num = parseFloat($("#page a b").text()) + 1;
    if (page_num <= number_of_pages) {
        go_to_page(page_num);
    } else {
        go_to_page(number_of_pages);
    }
}
function goTo() {
    var page_num = $('#page input').val();
    if (page_num > number_of_pages || page_num < 1) {
        page_num = 1;
        $('#page input').val("1");
    }
    go_to_page(page_num);
}
function go_to_page(page_num) {
    start_from = (page_num - 1) * show_per_page;
    end_on = start_from + show_per_page;
    $('.selected table tbody .content1').hide().slice(start_from, end_on).show();
    $("#page a b").text(page_num + "/" + number_of_pages);
}
$("#tag li").click(function(){
    page();
});


